#include "AugmentTable.h"
#include "Player.h"
#include "../SGD Wrappers/SGD_GraphicsManager.h"
#include "../SGD Wrappers/SGD_InputManager.h"
#include "MovingObject.h"
#include "Game.h"
AugmentTable::AugmentTable()
{
	//48x38
	m_hImage = SGD::GraphicsManager::GetInstance()->LoadTexture("resource/Graphics/WoodenTable.png");
}
AugmentTable::~AugmentTable()
{
	SGD::GraphicsManager::GetInstance()->UnloadTexture(m_hImage);
}

void	AugmentTable::Render(void)
{
	SGD::Point position;

	position.x = this->GetPosition().x - Game::GetInstance()->GetCameraPos().x;
	position.y = this->GetPosition().y - Game::GetInstance()->GetCameraPos().y;
	position.x -= m_szSize.width / 2;
	position.y -= m_szSize.height;

	SGD::GraphicsManager* pGraphics = SGD::GraphicsManager::GetInstance();
	if (tableType == 0) // Table is BulletType
	{
		pGraphics->DrawTextureSection(m_hImage, { position.x, position.y + 3 }, { 0, 0, 48, 38 }, 0, {}, { 255, 0, 0 });
		pGraphics->DrawString("B", { position.x + m_szSize.width / 3, position.y + m_szSize.height / 4 }, { 0, 0, 0 });
	}
	else if (tableType == 1)//Table is Shotstyle
	{
		pGraphics->DrawTextureSection(m_hImage, {position.x, position.y + 3}, { 0, 0, 48, 38 }, 0, {}, { 0, 255, 0 });
		pGraphics->DrawString("S", { position.x + m_szSize.width / 3, position.y + m_szSize.height / 4 }, { 0, 0, 0 });
	}
	else //Table is Movement Style
	{
		pGraphics->DrawTextureSection(m_hImage, {position.x, position.y + 3}, { 0, 0, 48, 38 }, 0, {}, { 0, 0, 255 });
		pGraphics->DrawString("M", { position.x + m_szSize.width / 3, position.y + m_szSize.height / 4 }, { 0, 0, 0 });
	}

	if (myEmitter)
		myEmitter->Render();
}
